#include "nand_w25n.h"
#include "bsp_spi_nor.h"

/*init spi interface*/
void nand_spi_init(void)
{

}

/*chip select control*/
void nand_spi_cs(uint8_t vol)
{
    w25n_cs(vol);
}

/*switch to spi or qpi*/
void nand_spi_mode(nand_spi_type mode)
{
    nor_spi_mode((nor_spi_type)mode);
    /*
    switch(mode)
    {
        case NAND_QPI_READ_MODE:
            break;
        case NAND_QPI_WRITE_MODE:
            break;
        default:
            break;            
    }
    */
}

/*read and write 1 bype*/
uint8_t nand_spi_rw(uint8_t wdata)
{
    return nor_spi_rw(wdata);
}

/*read n bytes*/
uint8_t nand_spi_read(uint8_t *prd, uint16_t len)
{
    return nor_spi_read(prd, len);
}

/*write n bytes*/
uint8_t nand_spi_cmd_send(const uint8_t *pwd, uint16_t len)
{
    return nor_spi_cmd_send(pwd,len);
}

/*write n bytes*/
uint8_t nand_spi_write(const uint8_t *pwd, uint16_t len)
{
    return nor_spi_write(pwd,len);
}

/*read n bytes*/
uint8_t nand_qpi_read(uint8_t *prd, uint16_t len)
{
    return nor_spi_read(prd, len);
}

/*write n bytes*/
uint8_t nand_qpi_write(const uint8_t *pwd, uint16_t len)
{
    return nor_spi_write(pwd,len);
}
